package com.bootdo.common.task;

import com.bootdo.collector.config.DruidDBConfig2;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.stereotype.Component;

import com.bootdo.oa.domain.Response;

import javax.sql.DataSource;
import java.security.Principal;

@Component
public class WelcomeJob implements Job{
	@Autowired
    JdbcTemplate secondaryJdbcTemplate;
    //SimpMessagingTemplate template;

    @Override
    public void execute(JobExecutionContext arg0) throws JobExecutionException {
        String a = secondaryJdbcTemplate.queryForObject("select count(1) from t_hot_words", String.class);
        System.out.println(a);
        //secondaryJdbcTemplate.query("select * from t_hot_words",);
        //template.convertAndSend("/topic/getResponse", new Response("欢迎体验bootdo,这是一个任务计划，使用了websocket和quzrtz技术，可以在计划列表中取消，欢迎您加入qq群交流学习!" ));

    }

}